package jdbc10_18;

import java.sql.*;

public class Test_4 {
    public static void main(String[] args) {
        try {
            Class<?> aClass = Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        String url="jdbc:mysql://localhost:3306/jv75";
        Connection root=null;
        PreparedStatement prs=null;
        try {
             root = DriverManager.getConnection(url, "root", "123456");
             String sql="drop table s_tt";
            prs = root.prepareStatement(sql);
            prs.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            try {
                if (prs!=null)
                prs.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            if (root!=null) {
                try {
                    root.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
